package ex.recruit.service;

import java.util.Iterator;
import java.util.List;

import modules.recruit.entity.Town;
import modules.recruit.form.TownForm;
import modules.recruit.service.TownService;

import org.springframework.util.ReflectionUtils;

import com.guinea.core.utils.BeanUtils;

public class TownServiceEx extends TownService {

	public void saveTownForms(List townFormList) {
		for (Iterator iterator = townFormList.iterator(); iterator.hasNext();) {
			TownForm townFormSuccess = (TownForm) iterator.next();
			Town town = new Town();
			try {
				BeanUtils.copyProperties(town, townFormSuccess);
			} catch (Exception e) {
				ReflectionUtils.handleReflectionException(e);
			}
			save(town);
		}
	}
}
